package com.payment.web.controller.system;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.payment.common.base.AjaxResult;
import com.payment.common.page.TableDataInfo;
import com.payment.common.utils.ExcelUtil;
import com.payment.framework.web.base.BaseController;
import com.payment.system.domain.MerchantUpgrade;
import com.payment.system.service.IMerchantUpgradeService;

/**
 * 商户升级 信息操作处理
 * 
 * @author payment
 * @date 2019-06-10
 */
@Controller
@RequestMapping("/system/merchantUpgrade")
public class MerchantUpgradeController extends BaseController
{
    private String prefix = "system/merchantUpgrade";
	
	@Autowired
	private IMerchantUpgradeService merchantUpgradeService;
	@GetMapping()
	public String merchantUpgrade()
	{
	    return prefix + "/merchantUpgrade";
	}
	
	/**
	 * 查询商户升级列表
	 */
	@PostMapping("/list")
	@ResponseBody
	public TableDataInfo list(MerchantUpgrade merchantUpgrade)
	{
		startPage();
        List<MerchantUpgrade> list = merchantUpgradeService.selectMerchantUpgradeList(merchantUpgrade);
		return getDataTable(list);
	}
	
	
	/**
	 * 导出商户升级列表
	 */
    @PostMapping("/export")
    @ResponseBody
    public AjaxResult export(MerchantUpgrade merchantUpgrade)
    {
    	List<MerchantUpgrade> list = merchantUpgradeService.selectMerchantUpgradeList(merchantUpgrade);
        ExcelUtil<MerchantUpgrade> util = new ExcelUtil<MerchantUpgrade>(MerchantUpgrade.class);
        return util.exportExcel(list, "merchantUpgrade");
    }
	

}
